{#
INPUT:

- worksheet -- Worksheet object

- publish -- boolean whether this is for the published version

- do_print -- boolean whether this is for a print version

#}

{% set wrap = conf['word_wrap_cols'] %}
{% if not publish %}
    {% set publish = worksheet.is_published() %}
{% endif %}

<div class="cell_input_active" id="cell_resizer"></div>
{% if not publish %}
<div class="worksheet_cell_list" id="worksheet_cell_list">
{% endif %}

{% for cell in worksheet.cell_list() %}
    {{ cell.html(wrap = wrap, div_wrap = true, do_print = do_print or publish) }}
{% endfor %}

{% if not do_print and not publish %}
</div>
<div class="insert_new_cell" id="insert_last_cell"></div>
<script type="text/javascript">
    $("#insert_last_cell").bind("plainclick",function (e) {
        insert_new_cell_after(cell_id_list[cell_id_list.length - 1]);
    });
{% if not worksheet.docbrowser() %}
    $("#insert_last_cell").bind("shiftclick",function (e) {
        insert_new_text_cell_after(cell_id_list[cell_id_list.length - 1]);
    });
{% endif %}
</script>
{% endif %}
